package com.supreme.studyserver.controller;

import com.supreme.commonboot.utils.AjaxResp;
import com.supreme.studyserver.service.PressureService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "pressure")
public class PressureController {

    @Resource
    private PressureService pressureService;

    @PostMapping(value = "simple")
    public AjaxResp simpleTest() {
        pressureService.simpleTest(1000);
        return AjaxResp.instance();
    }

    @PostMapping(value = "interrupt")
    public AjaxResp interruptTest() {
        pressureService.interruptThread();
        return AjaxResp.instance();
    }
}
